#include "MainPage.h"
#include "Snake.h"
#include "Container.h"

Container *Clothing_Page = nullptr;
Container *Head = nullptr;
Container *Head_Flower_hat = nullptr;
Container *Head_Sunglasses = nullptr;
Container *Profile_Picture_Frame = nullptr;

ClotherType ClothingType = CLOTHING_DEFAULT;

bool Display = false;

void Display_Clothing_Page()
{
    if (!Display)
    {
        Clothing_Page->set_Visible(true);
        Display = true;
    }
    else
    {
        Clothing_Page->set_Visible(false);
        Display = false;
    }
}

void Move_Profile_Picture_Frame_Head()
{
    Profile_Picture_Frame->align(LEFT_CENTER, 50, 0);
    ClothingType = CLOTHING_DEFAULT;
}

void Move_Profile_Picture_Frame_Head_Flower_hat()
{
    Profile_Picture_Frame->align(CENTER);
    ClothingType = CLOTHING_FLOWER_HAT;
}

void Move_Profile_Picture_Frame_Head_Sunglasses()
{
    Profile_Picture_Frame->align(RIGHT_CENTER, -50, 0);
    ClothingType = CLOTHING_SUNGLASSES;
}

void create_Clothing_Page()
{
    Clothing_Page = new Container(Main_Page, 350, 150);
    Clothing_Page->set_background_image("./res/Clothing_Page.bmp", true, 0x00ffffff);
    Clothing_Page->align(BOTTOM_RIGHT, -90, 0);
    Clothing_Page->set_Event_Type(CLICK);

    Head = new Container(Clothing_Page, 60, 60);
    Head->set_Visible(true);
    Head->set_background_image("./res/head1.bmp", true, 0x00ff0000);
    Head->set_Event_Type(CLICK);
    Head->set_Event(Move_Profile_Picture_Frame_Head);
    Head->align(LEFT_CENTER, 50, 0);

    Head_Flower_hat = new Container(Clothing_Page, 60, 60);
    Head_Flower_hat->set_Visible(true);
    Head_Flower_hat->set_background_image("./res/head_Flower_hat1.bmp", true, 0x00ff0000);
    Head_Flower_hat->set_Event_Type(CLICK);
    Head_Flower_hat->set_Event(Move_Profile_Picture_Frame_Head_Flower_hat);
    Head_Flower_hat->align(CENTER);

    Head_Sunglasses = new Container(Clothing_Page, 60, 60);
    Head_Sunglasses->set_Visible(true);
    Head_Sunglasses->set_background_image("./res/head_Sunglasses1.bmp", true, 0x00ff0000);
    Head_Sunglasses->set_Event_Type(CLICK);
    Head_Sunglasses->set_Event(Move_Profile_Picture_Frame_Head_Sunglasses);
    Head_Sunglasses->align(RIGHT_CENTER, -50, 0);

    Profile_Picture_Frame = new Container(Clothing_Page, 60, 60);
    Profile_Picture_Frame->set_Visible(true);
    Profile_Picture_Frame->set_background_image("./res/Profile_Picture_Frame.bmp", true, 0x00ffffff);
    Profile_Picture_Frame->align(LEFT_CENTER, 50, 0);
}
